package com.drg.center.service;

import com.drg.center.entity.param.CaseMonitorPageDTO;
import com.drg.center.entity.param.CaseProfitLossDTO;
import com.drg.center.entity.param.DepartServiceEfficiencyDTO;
import com.drg.center.entity.result.*;

import java.time.LocalDate;
import java.util.List;

/**
 * @Author: zhangxilin
 * @Date: 2024/12/5
 */
public interface StatisticsFromEsService {

    /**
     * 病历总览统计
     * @param departCode 科室编号 null: 全院总览
     * @param startDate
     * @param endDate
     * @return
     */
    PatientCaseSttVO overveiw(String departCode, LocalDate startDate, LocalDate endDate);

    /**
     * DRG费用汇总
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    DrgSttVO drgstt(String departCode, LocalDate startDate, LocalDate endDate);


    /**
     * 亏损科室TOP5
     * @param startDate
     * @param endDate
     * @return
     */
    List<KeyValueVO> getDepartTop5(LocalDate startDate, LocalDate endDate);


    /**
     * 亏损病组TOP5
     * @param departCode 科室编号 null: 全院总览
     * @param startDate
     * @param endDate
     * @return
     */
    List<KeyValueVO> getDrgTop5(String departCode, LocalDate startDate, LocalDate endDate);


    /**
     * 科室盈亏占比
     * @param startDate
     * @param endDate
     * @return
     */
    ProfitLossMixVO getDepartProfitRateStt(LocalDate startDate, LocalDate endDate);

    /**
     * 病组盈亏占比
     * @param departCode 科室编号 null: 全院总览
     * @param startDate
     * @param endDate
     * @return
     */
    ProfitLossMixVO getDrgProfitRateStt(String departCode,  LocalDate startDate, LocalDate endDate);

    /**
     * 全院费用总趋势
     * @param year
     * @return
     */
    List<KeyValueVO> getCostTrend(Integer year);

    /**
     * 入组率趋势
     * @param year
     * @return
     */
    List<KeyValueVO> getInDrgTrend(Integer year);

    /**
     * 病历盈亏分析
     * @param param
     * @return
     */
    CaseProfitLossAnalysisVO caseProfitLossAnalysis(CaseProfitLossDTO param);


    /**
     * 病组盈亏分析
     * @param departCode
     * @param drgCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<DrgAngleSttVO> getDrgProfitLossList(String departCode,String drgCode, LocalDate startDate, LocalDate endDate);
    /**
     * 科室盈亏分析
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<DepartProfitLossPageVO> getDepartProfitLossList(String departCode, LocalDate startDate, LocalDate endDate);

    /**
     * 科室费用分析
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<DepartAngleSttVO> getDepartCostSttList(String departCode, LocalDate startDate, LocalDate endDate);

    /**
     * 问题数据统计BY YEAR
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MainDataColumnChartVO> getProblemDataByYear(String departCode, List<String> mainSearchDepartCodeList, LocalDate startDate, LocalDate endDate);

    /**
     * 问题数据统计BY 科室
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<DepartDataStatVO> getProblemDataByDepart(String departCode,List<String> mainSearchDepartCodeList,  LocalDate startDate, LocalDate endDate);


    /**
     * 医疗服务质量统计
     * @param startDate
     * @param endDate
     * @return
     */
    DataMedicalServerqualityVO getMedicalServerquality(List<String> mainSearchDepartCodeList,LocalDate startDate, LocalDate endDate);

    /**
     * 科室服务效率
     * @param param
     * @return
     */
    List<DepartServiceEfficiencyPageVO> getDepartServiceEfficiencyList(DepartServiceEfficiencyDTO param);

    /**
     * 科室死亡率
     * @param param
     * @return
     */
    List<DepartDieRatePageVO> DepartDieRateList(DepartServiceEfficiencyDTO param);

    /**
     * 医疗服务能力-总览
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    MedicalServiceOverviewVO getMedicalServiceOverview(String departCode,List<String> mainSearchDepartCodeList, LocalDate startDate, LocalDate endDate);

    /**
     * 医疗服务能力-rw分布
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    DifficultCaseDistributeVO getDifficultCaseDistribute(String departCode,List<String> mainSearchDepartCodeList, LocalDate startDate, LocalDate endDate);

    /**
     *  医疗服务能力-列表
     * @param departCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<DepartAngleSttVO> getMedicalServiceByDept(String departCode,List<String> mainSearchDepartCodeList, LocalDate startDate, LocalDate endDate);

    /**
     * 在院病历统计
     * @param param
     * @return
     */
    CaseMonitorStatVO getCaseMonitorStat(CaseMonitorPageDTO param);

    /**
     * 科室例均费用分布(DSL-121)
     * @param year
     * @param departCodeList
     * @return
     */
    ChartLineVO getDepartAvgCostTrend(Integer year, List<String> departCodeList);
}
